Fix for 1005

fixes #1005