updated Task object to handle custom error