Switched to using gapi's onload function instead of a self-executing function.