Adds check for deselect

fixes #1458