Fixing selection bug