Bugfix when refreshing view