fixes for updatesql