BUGFIX: make main weak, so that it may be overridden