fixing malloc