added logging and client