fixes #784 in master