fixed bugs and add logging task completion time to console