Added the check in more places