check if result exists before comparison