fixed small bug in success-callback that uses non-existant var