fix script/magic interaction