Attempt to solve issue #38: Task state change problem