fixed bug in viewer and textbook .js