some fixes, working sqlite login and reorder code