use function to prevent invalid https http cross domain actions