added cross domain logic