resolved cast on keypress