fix bug: inContext not returning function