log before return