Should also maybe check that `$options['fields']['dir']` isn't empty or something, which i think is actually what you want.