better visible/invisible detection