trying inside function