Defects in perovskite-halides and their effects in solar cells