fixing viewer bugs