changed registration to ajax POST request