make sure type comparison is right