fix bugs in get_njob