bugfix: bad logic