log improvment and try with exceptions