Fixing background selection bug