make script runnable on standalone environment