added key press func
fixed the issue