Fix null ref error when header is hidden