fix for logic