Fix repeated query in category index for logged in users