Added workaround for null-pointer problem