add perms and review code