deals with javascript gc and abortion; fixes #2