implemented learn protection functionality