js validate register fix