Updated to include the proper logging code