added BaseModel class and finally got it to work