I moved the crates position being changed to happen before LidGoPos is defined, but the issue still occurs.