change release logic

I modified some node handling logic in release function.