for on_read callbacks use onerror style