fixed the issue with RemoveObserver function