replaced system_timer with timeout because ruby1.9 incompatibility issue