Adding logging for debugging.