Moved ajax call inside kinect user function