fixing some old bugs