Perovskite photodetector stability