added logging
improved logging