many bug fixes on pages and masks create/edit