fixed crash on close