added conditions if exists