connect to db and fix widgets error