fix sql exception