Fix same origin bug