Changed the ajax issues and fixed some other minor issues