Changed register process to use ajax