replaced malloc with new for camera