Check for valid key in  before applying