almost working registration