stage layers length fix
Merge pull request #369 from alexahn/master

stage clear fix