fixed database opening infinitely
fixing opening database infinitely