fix my logic error