Bug fix: check buffer