fix db stuff