fix parsing of file extension