upgrade db design and fix login