bug in register controller