Add check for existing directory