fix overlap bugs, properly implement state change with text field event listeners