added a backwards-compatible callback system