works ok for registration