fix function clause error