fixing event handlers locking