make script "reentrant"