db errors fixed