added extra conditions