fixed bugs stemming from new jquery version and me being awful at programming