added assign variable using keypress function