added ajax call optimization