Bug Fix: for issue #581