add user login, layouts, fix some bugs