fixed bug with registration