register logic ok. will move to mongodb.