fix crash when data directory doesn't exists