added logging and others