Fixed crash on class change