I've had another look and added an extra safeguard to prevent this from happening. Thanks again for helping me solve this.