small sql exception fix