update code to not use deprecated jquery function