Automating loan write-off