fixed some controller bugs