A man has been given another chance after admitting breaching his bail for a second time.
Ryan Kneen is due to face a trial on October 25 after denying an attempted burglary.
The 33-year-old has been granted bail until then, with a condition to reside at probation accommodation Tromode House in Ballafletcher Road in Douglas.
One of the conditions of living there is to abide by an 11pm curfew.
However, on September 22, the probation accommodation reported that Kneen had not returned by the curfew.
Prosecuting advocate Barry Swain told the court that, as there was still a place open to the defendant at Tromode House, he would not oppose him being re-bailed.
Defence advocate David Clegg said that Kneen had intended to get a bus back from Port Erin, but had not realised that the timetable was different on a Sunday, and there was no bus at the time he had thought.
Kneen said that his phone had no charge and he had no money for a taxi, so he had decided to try to walk back to Douglas.
He had got to the top of the Sloc, where it was pitch black and there was little traffic.
Kneen said he then decided to crawl under a bush and go to sleep, before going back to the house in Port Erin the following morning, where he was found by police.
Mr Clegg said that his client had been engaging with the Drug and Alcohol Team as well as mental health services, and doing better before this blip.
Deputy High Bailiff Rachael Braidwood agreed to allow bail to continue until the trial date.