kinda working registration and authorization