changed cryptic error message if memory alloction fails