Added edit btn
Handle more case in the StateListener to track changes in notes