fixed empty thread BUG
fixed AFTER event BUG