merged changes to stage_data.py