string buffer resetting