Fixed a bug in the callback system