fixed bug so as to skip invalid collections