adding key handling.