fixing small JS error in registration