add check if config dir exists before creating it