Fix server side error when creating a task