add common logic