fixed the back end of login. Child can be added correctly to the db