Added uid and gid parameter to filter functions