fixed various issues with controller