fix public url algorithym