added a test for the  singleton restriction and fixed its implementation