Adds check for deselect

fixes #1458 

I can't reproduce this bug but it looks like this is going to fix it

should make #1461 unnecessary