improved logging slightly