Fix issue 307

fix for issue #307