fix "use before set"