Add register function in the MainActivity