move logging statement