trying to fix the selection bug