fixed undefined value in comparison