Fix attribute dialog crash on close