Updated code to handle kernel and user pagedir set page