calling the right function