bug fix for multiple calls for keyup function