fixed a bug in the previous commit