Fix unmount logic