fixed a series of bugs