A repentant burglar who stole a laptop from the wrong house was caught after he returned it, a court has heard. Gareth James, 41, broke into a house in Brecon, Powys, Wales, believing it was the home of someone who owed him £400.
But when he opened the laptop he stole, he saw the wrong name on the screen, Merthyr Crown Court was told.
James, of Llanfaes, near Brecon, admitted burglary and was jailed for four months, suspended for a year.
Prosecutor Rachel Knight told how James confessed to a barmaid at the Boar's Head pub about his crime.
Miss Knight said: "He told her he had done something stupid. He felt embarrassed he had gone into the wrong house."
James told her he had gone into the house thinking that the occupier owed him £400 for building work but his only intention was to keep the laptop until he paid up.
But when he saw the wrong name he realised he had gone into the wrong house.
He was caught and arrested when he went back to return the laptop, letting himself in through an open door.
Sentencing him, Judge Richard Twomlow jailed James for four months suspended for 12 months with supervision and ordered him to complete the thinking skills programme.