if condition added as buffer