return error status in case of error