fix #6 Make this work as an applet