Added counter, change keyup event handling