implement top and stage state