Renamed onRequest to handleRequest in anon function