fix, still having some issues with null termination