added a small check when creating config directory