bugfix: logic error