fixes to sql to update task