fixed hidden sql errors