fixed pause bug by attaching to index.html