Resolved a race condition in fade out code