implemented action to store node collapse state