define variables outside if statement