jquery modified and fixed issues