added part of the logic for the Register button