added observer code