Selecting modal incorrectly