A court heard he had 'not learned his lesson'