fixing jQuery errors