Fix mod

Some mess up with if condition.