fixed a few bugs on tile selection