fixed bug when top view doesn't belong to uiviewcontroller