fixing comparison error