Fixed error related to buffer