fixed data allocation issue. Added test suite for allocation test