fixed issue 1252, thanks Mark Weissen