some fixes to identity and security