possible fix for -1012 error (issue #41)