moved logging calls