Reworking the fix for the logic