update deprecated method

sendRequest & onRequest were deprecated in V20+