Fixed wrong type comparsion