added grid filter code