fix sql options for count