fixed a corner case for issue #394