click function to pass filename