some script improvements