fixed bug in re-executing code