start and end scripts run automatically