add in out login state and update db