working on sql corrections