Parameterise function to take the work id