add exit after header redirect to fix it on https