added repair function with dbpath var