added unmount logic