fixed bug occuring with an empty result set