fixes #46 TypeError on no data returned from query