Adding a defensive check