fixed various issues relating to handling logged in users

updated docs