added check for null,null at comparator