* fix for the PHP warning: get_resource_type() expects parameter 1 to be resource, object given