setting up basic logic for registration