fixing bug that caused SQL errors at startup