Added modal and changed code to ensure validation of all pages