fixed a bug with trimUrl, Added unit test for that method.