Declare local variables before if statement.