Move log inside try