use auto size buffer for random