Still have trouble reading database but fixed crash if loading fails