Added check for valid key.