a logic fix