Fixed Sharepoint issues

Fixed bug where Sharepoint user who isn't logged in causes error