Fix #349 Perfomance problems on large sites with user logins

Fix #349 Perfomance problems on large sites with user logins