fixed controller bugs