fix register text_handlers
support `next(err)`