added debug, fixed bug witch dose not update the job in the database