better checking for alloc... thank you everybody for great unit tests :)