fix samples cursor ref bug