Removed initialization of buffer in loop