changed $(document.. to jQuery(document