viewer working , but leaks memory