modified models to handle database