fix registration and permission checks