added newUser function to dao
various bug fixes