changed to read/write tasks from mongodb