Subsite authentication fixed + better error handling