undefined database fix