fix #18 Invalid URLs treated as valid