Add user registration and fixed merge mess.