re-fix if block