added logging to controller