Moved local variable into local scope to avoid it being created when not used.