freeing up mem in destructor and made max buffer size more sane