changed to pass data dir