call the right func