fixed bug where app would crash if it lost database connectivity