add basepage handling code