fixes #14. Thanks @mangstad