fixed buffer size to return correct ID. code cleanup