fixed bug when datadir is not absolute