Fixed a bug that failed to remove events which timeout