Fix to prevent redundant code execution.