compatibility with VS2013
fixed buffer overflow