Fixed crash on close