fix function cause error.