implemented usage of timeout