Add toggle edit state and ui fixes