make script synchronous