updates to support logging in with a username OR email plus some bugs