added visibility check to element view