fix register bugs for view