fetch url in separate func