fixed bug in registeration