fixed a bug introduced a few commits back