bug fixes on url parsing