fixed callback signature to include err part