Fix blocking problem by adding a timer.