Fix learn endpoint

Fix #1238