lib: add retry policy