fixed a bug cause crash

when view attach status change