changed select to where