fixed error on key assignment