Fix bug when user registers