Logic flaw fix