changed event methods and fixed jquery plugin