check buffer size