implemented changing of page state in UI