fixed crash in vs2010 version