Alleviating halide perovskite surface defects