added database recovery on app start.