Why are you reassigning the local variable right before exiting the function?