fix logic error in greater than