Somewhat made the ajax call to method of function work.