change initialize and add retry function(no limit to number of retry times)