fixing the cross origin bug