add some protection on uri extension parsing