add error message when out of memory