added debug, single and ability to record tasks to database