Forced the redirect code to return if there is an error.