allow to take fn as argument