removed cast in front of malloc