Added logging to controller