add a if to test whether an observer has already been added or not