The function is called before the client library is loaded so the api is not recognized on script run :(((