revised and fixed observe implementation