added erro handling to missing key code but commented it out because it goes of with shift