Change condition for returning proper dbpath