implemented SetTimeout method