added setup_task function