Changed learn handler to handle XMLHttpRequest from browser