fix wrong select statement