Added the select statement to correctly process input.