fixed issue where we were growing 512 bytes more than requires