Created return error function.