Fixed another logic error