remove trigger, add function, fix login exception