Made header validation work without doing 302 redirect