fixing bugs

fixing some bugs before running