select statement fix