Added check for remote ip when checking headers