add register controller code