fix some bugs when extension was blank