added some script logic