model class connects to database now