fix register page bugs and show errors