fixed issue #711, #687