Applied fix to destroy error with JQuery 1.9.