registration JS error fixing