bug fix for comparison with q