Fixed bug in debug record method