Add losing condition
Prevent error when clicking behind characters