Fixed bug where tasks would appear twice or more in the completed tasks option in the DB