[UPDATE] fixed the models and setting up db links