Zoho.userloginid to variable

Zoho.userloginid to variable

I have an application that gives our clients access to complete questionnaires.  Since I want them to have access only to their records, I setup views that display records according to the zoho.loginuserid.  The views work fine, however the html pages typically display an error on the first attempt, then after refreshing the browser, it works.  The same happens when trying to print the page...first attempt gives an error, then second attempt works.

The only thing that may make a difference is that I have an "if" statement to look at the zoho.loginuser. 

I setup a parameter for the report 'vLogin', then it checks to see if the email login id is from our company or not.  If it recognizes someone from our company is logging in the
then it assigns the email (username) of one of our clients to the variable so it will pull fet their records and display the report.

   input.vLogin = zoho.loginuserid;
    if (zoho.loginuserid.contains("ghsaviationgroup"))
    {
        input.vLogin = " xxx@xxx.com";
    }


And as I mentioned... it works but almost never on the first attempt, only on refresh
Any Ideas?