fixed a couple bugs