updated to remove plainsql
updated to remove plainsql