bugfixes with users and permissions