fixed some bugs that didn't allow to store the job