fix function parsing bug