handle the keep attributes. Nodes with keep attribute stay in the keep-alives