fix crashing controller