changing logic for if view exists