minor bug of sql