Change wrong variable asignment order