fix failing logic