added oom error handling