setting permissions on data dir correctly