solved a function problem