fixed assert issue, need better error checking for alloc routines