Remedy inconsistency in jenkins script