Set up simple hinged mug skeletal rig

Having a lot of trouble setting up a basic skeletal rig so I can have a flapping lid.

Whenever I simulate the lid goes through the cup even though there bodies setup