Fix for issue #1585
Merge pull request #1603 from ghost1227/bugs/1585

Fix for issue #1585