fixing "selectedIndex is undefined" error; continuing entity moving implementation