check len of incoming buffer