fixed problem in add method which caused a sample to enter the buffersometimes more than once
added and debugged sample register