helper function for interaction