added tests + fixed registeruser