fixed bug with clearing the obs. array more than once