Fix exception on page viewing