fix javascript for register dialog