implemented the registerassingleton functionality