fixes issue 629, already pull requested by funnyman3595