fix redeclare function