fixed crash on Close