added length method to returns the record number of collection