Improved the drop query for keys