added a logging function and a message on enable