Added support for max timeout