Reorder code and andded method orig to get Origin header