Fixed cross origin bug