fixed bug while switch views