first attempt to resolve bug #39