bug fix
wrap handler provided from java to ensure it has hashCode method
fix leave handlers not being reset