corrects event handling on inputs