Added a bound checking when data is loaded to write buffer