fix jobs skipping in line from database querying