Changed how jquery function works.