checks of dir exists before creating it