always returned an error object fixed