Fix db creation problem

Checks path exitence  not files