Change register function to automatically pass input name.