change directory fdir default to NULL so it uses what is in database
directory