fixed/updated ajax response handling