Added callback functions 'afterPageChange' and 'beforePageChange'