tried to fix segfault in icon loading code