refactor to make the select work
working demo