Added when statement