modified publish script