ajax calls copied to all new functions