Avoiding unecessary event handling for empty hash