calling function after the prompt