fixed callback code