Fix for issue 583

this commit fixes #583