working on logging correctly