properly detach views when refreshing