I used to have a chi that would pee in my bed at night. It turned out I think he was scared to jump in the dark. I just put a suitcase for him to jump on before the floor, and installed a night light in the hall, so it wasn't too bright but it wasn't super dark, and he did fine.