Add correct variable initializing to select change function.