Fixed the bug with training mode