fixing database stuff