add test for memory error