fixing this function that was not explicitly using the params