fix potential bug with float equality