Adding timeout value to prevent 100% cpu