Added waiting code while the ajax call is executing and updated the waiting gif