fixed a bug or two