fix only call callback when function