remove this cast and change the function signature as above.