fix potential static memory corruption