fix the error when filter is NULL, add the S4 support