added pages control and menu directives