unregister events before register