Add check in predict function as well