app passes state to views when registered