login & join: writing db