added /register function