removed duplicate sql