another small logic error