refactoring due to jquery 2 upgrade #428