Some Electrical Help Please...

They work with the headlight switch ON. With the lights on and the doors open the dome light is on. Shut the door with the headlights on and the dome light goes out.
All I'm saying Rob is that is not how they should be wired...............