updating code for Google Apps integration