add exception and fixed some callback bug