Fixed a bugged when removing observer.