fixed scoping of stringbuffer access.