Methylammonium iodide and its effect as an intrinsic defect in perovskite structure and device performance