Fix some bugs

* The handle_error has no meanings
* The on_next_predicate is defined above line.