Making the ajax call dynamically