rough fix db stuff