update database and check if the registered username existed