fixed compare statement