some issues with learn function