fix logged view and remove repeat query