fixed some code, now new issues with jquery fxn