fix some controller bugs