Updated page handler to more correctly terminate user programs