Corrected handling of error response when task is already created