fix bug:function declaration
fix reference to record