check for key before using it