Thanks for the reply its a bit difficult to explain so I will try with the help of the picture.
When it is shut close the latch should move up when in contact with bracket, so it slides up the front then drop in the catch part.
Then when twisted it can come apart to 45 degrees, what I want it to do is recognize that a solid body its there.
I hope this explains a bit better than before.