Fix undefined var in ScpTask

ScpTask will raise a notice because of undefined variable "counter".