add support for timeout on callbacks