updated pretty uri function