modified Run function