fix comparison to undefined