handle memory full case