Subscribe | UPI Odd Newsletter Subscribe SOUTH PORTLAND, Maine, April 4 (UPI) -- A homeless man in Maine woke up to a nice surprise on Thursday morning -- $37,000. Police were called to a TD Bank branch in South Portland after a woman reported that a homeless man was spending an extended period of time in the bank’s ATM. Advertisement When the authorities arrived, they saw the man filling up a shopping bag with cash. Apparently the man used his bank card to take out $140 and then the machine just kept going. All told, the ATM dispensed more than $37,000. "He was using his bank card to request more money,” South Portland Police Lieutenant Todd Bernard told WGME. The police were able to recover the cash and return it to the bank. Police say the bank does not intent to press charges against the man. "I think that's really nice of them, and I think it's the right thing to do. Obviously he was kind of tricking the system a little bit. But it was partially their fault for not having the right security on it,” said area resident Sarah Howard. Advertisement But a TD Bank spokesperson said the large cash payout was due to a "code error." The bank says no customer accounts were affected. The ATM is still out of service. [WGME] [Bangor Daily News] Read More Siemens tasked with control system for South Stream Texas executes Tommy Lynn Sells for killing teenage girl in 1999 Maersk Drilling sees need for new rig fleets Norway opens waters to energy bidding