fix bug when version is undefined