Timeout

There might be some issues regarding thread safety. I havent tested it so far.