fixed code for full rerun