ajax pry function corrected