added observerPattern using jquery