implemented wait timeouts