fix emit of done after errors
Merge pull request #26 from dontcallmedom/fixviewportdone

fix emit of done after errors