#128 fix bug in WaitEvent also replace tabs with 3 spaces