Resetting respective variables on page removal