Fixind db issues