Israel says it foiled Hamas plans for Jerusalem attacks