Added functionality to pass data between pages