fix implementation of timeout!