fixed hard crash on changing tabs