fixed grade filters db function