fixes #121

I'm unsure what the old code was supposed to do, but it seems that it failed doing something similar