added timeout, value is in SECONDS but you can use milliseconds insteam