added support for empty result sets