Updated to enable logging mode