refactor ticket module a bit after update, and fix socket issue