logging for controller and some minor fixes