fixed regression introduced in issue #14

corresponds to issue #40