Fixed update sql issue