Hamas says it is working to avoid escalation with Israel