refactor fix_mod

fix unreachable condition
use b