Fixed Malloc Bug