added callback for ajax requests