fix function testing