Check for key function