small logic error fixed