improve loggin and fix minor issues