added objects and database thread functionality