connecting to db only once when registering app