added conditions and messages