fixed bug stack corruption detection