fix a logic