Added guard for log action