fix for #17 thanks to @ahocevar