simple working registration with validation