moved DB query

moved querying the DB away from Application into loginregister as it
doesnt need to be called other than at program start