modified stage.sh