Fix app crashing from database error