Debugging/improving event-handler.