fixed a fewminor bugs