[Update] Converted direct buffers to heap (This is probably inefficient
and should be changed)