finish basic registration function