wrap the Log Action in an if test

When logging out there are sometime console errors. I suspect the
app.user is destroyed before the rest call is complete