adding in short circuit handling