Added option to set db directory