Variable used before declared fix