changed to jquery plugin