fix select statement problem