fixes #21. Thanks @skaae