call the right function