add timeout for not blocking the ui