some debugging for memory error