Added read memory error handling