updated filtering to work with object of objects