added loop in stageout
small changes