add logic for creating data dir if it does not exist