removing observer function