only call callback when it's a function