move identifier check to the top of the equals