Add check for the redirect location