added gui factory
fixed segfault because of ui initialization priority