fix for cross domain (it was always using localhost)