fixed R/S counter