Fix TypeError exception in db.py on add activities

Fix TypeError exception: tuple indices must be integers, not str.