debug: X must be function