fixed a bug in the collection class for PHP 5.2