Updated prepare data method in model.php