Fixed the multiple ajax calls