fix a bug where you can get a server error if there are no jobs in the database