added better logic to the links in the header of the agendaview