Fixing the Ajax issues

Fixed all the ajax issues.