added observer functunality.