adding functionality for editing pages