Fixed crash issue by buffer overflow