Added an allocation check