try to fix issue #27, not sure whether it works or not