[TASK] Fix order of variable assignment