cross origin bug fix