fix some bug for using select