db and model fix