fixed incorrect comparsion