Function Check and Bug Solved

Check more functions and solved bug fix(now assigned tickets decrease on delete)