handle event for console