Added condition for execution SQL insert commands