updated model connecting to database