handled edge cases for undefined comparison values