Corrected SetPage

setpage function should work correctly now