fixing nested list bug