fixes #1162
fixes #1166