Check for key before setting