Fix order of assignment issue