updated tests and permission controls