added support for priority in completed tasks