fixed handling empty result