Fix closing not active part bug.