fixed sample updating